<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>提交分析任务 - 基于Hadoop的降雨量分析系统</title>
    <style>
        :root {
            --primary: #3b82f6;
            --primary-dark: #2563eb;
            --secondary: #10b981;
            --background: #f3f4f6;
            --text: #1f2937;
            --text-light: #6b7280;
        }
        body, html {
            margin: 0;
            padding: 0;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background-color: var(--background);
            color: var(--text);
            line-height: 1.6;
        }
        .container {
            max-width: 600px;
            margin: 2rem auto;
            padding: 2rem;
            background-color: white;
            border-radius: 8px;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        }
        h1 {
            color: white;
            text-align: center;
            margin-bottom: 2rem;
        }
        .form-group {
            margin-bottom: 1.5rem;
        }
        label {
            display: block;
            margin-bottom: 0.5rem;
            font-weight: bold;
            color: var(--text);
        }
        input, select {
            width: 100%;
            padding: 0.75rem;
            border: 1px solid #d1d5db;
            border-radius: 4px;
            font-size: 1rem;
            transition: border-color 0.3s ease;
        }
        input:focus, select:focus {
            outline: none;
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
        }
        button {
            display: block;
            width: 100%;
            padding: 0.75rem 1.5rem;
            background-color: var(--primary);
            color: white;
            border: none;
            border-radius: 4px;
            font-size: 1rem;
            font-weight: bold;
            cursor: pointer;
            transition: background-color 0.3s ease;
        }
        button:hover {
            background-color: var(--primary-dark);
        }
        .form-header {
            background-color: var(--primary);
            color: white;
            padding: 1rem;
            border-radius: 8px 8px 0 0;
            margin: -2rem -2rem 2rem -2rem;
        }
        .form-footer {
            background-color: var(--background);
            padding: 1rem;
            border-radius: 0 0 8px 8px;
            margin: 2rem -2rem -2rem -2rem;
            text-align: center;
            font-size: 0.875rem;
            color: var(--text-light);
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="form-header">
            <h1>提交分析任务</h1>
        </div>
        <form id="taskForm">
            <div class="form-group">
                <label for="region">地区</label>
                <select id="region" required>
                    <option value="">请选择地区</option>
                    <option value="beijing">北京</option>
                    <option value="shanghai">上海</option>
                    <option value="guangzhou">广州</option>
                    <option value="shenzhen">深圳</option>
                    <option value="chengdu">成都</option>
                </select>
            </div>
            <div class="form-group">
                <label for="startDate">开始日期</label>
                <input type="date" id="startDate" required min="1979-01-01" max="2024-12-31">
            </div>
            <div class="form-group">
                <label for="endDate">结束日期</label>
                <input type="date" id="endDate" required min="1979-01-01" max="2024-12-31">
            </div>
            <div class="form-group">
                <label for="analysisType">分析类型</label>
                <select id="analysisType" required>
                    <option value="">请选择分析类型</option>
                    <option value="monthly">月度降雨量分布</option>
                    <option value="yearly">年度降雨量变化</option>
                    <option value="trend">降雨趋势预测</option>
                    <option value="comparison">地区降雨量对比</option>
                </select>
            </div>
            <button type="submit">提交任务</button>
        </form>
        <div class="form-footer">
            <p>提交后，您可以在任务状态页面查看分析进度</p>
        </div>
    </div>

    <script>
        document.getElementById('taskForm').addEventListener('submit', function(e) {
            e.preventDefault();
            const task = {
                region: document.getElementById('region').value,
                startDate: document.getElementById('startDate').value,
                endDate: document.getElementById('endDate').value,
                analysisType: document.getElementById('analysisType').value
            };
            console.log('Task submitted:', task);
            // Here you would typically send the data to your server
            alert('任务已提交！请在任务状态页面查看进度。');
            // Redirect to task status page (uncomment and adjust as needed)
            // window.location.href = '/task-status.html';
        });
    </script>
</body>
</html>